import jwt
import datetime

# JWT配置
secret = "jc-multi-tenant-system-manager-1234567890"
algorithm = "HS256"

# 创建payload
payload = {
    "sub": "user001",
    "loginName": "user001",
    "fullName": "测试用户",
    "tenantId": "tenant001",
    "iat": int(datetime.datetime.now().timestamp()),
    "exp": int((datetime.datetime.now() + datetime.timedelta(hours=24)).timestamp())
}

# 生成JWT
token = jwt.encode(payload, secret, algorithm=algorithm)
print(f"JWT Token: {token}")
